import request from "@/utils/request";

// 物业费相关接口
export function getPropertyFees(params) {
	return request({
		url: "/propertyFee",
		method: "get",
		params,
	});
}

export function getPropertyFee(id) {
	return request({
		url: `/propertyFee/${id}`,
		method: "get",
	});
}

export function createPropertyFee(data) {
	return request({
		url: "/propertyFee",
		method: "post",
		data,
	});
}

export function updatePropertyFee(id, data) {
	return request({
		url: `/propertyFee/${id}`,
		method: "put",
		data,
	});
}
export function deletePropertyFee(id) {
	return request({
		url: `/propertyFee/${id}`,
		method: "delete",
	});
}

export function updatePaymentStatus(id, data) {
	return request({
		url: `/propertyFee/${id}/payment-status`,
		method: "patch",
		data,
	});
}

// 物业设备相关接口
export function getEquipments(params) {
	return request({
		url: "/propertyEquipment",
		method: "get",
		params,
	});
}

export function getEquipment(id) {
	return request({
		url: `/propertyEquipment/${id}`,
		method: "get",
	});
}

export function createEquipment(data) {
	return request({
		url: "/propertyEquipment",
		method: "post",
		data,
	});
}

export function updateEquipment(id, data) {
	return request({
		url: `/propertyEquipment/${id}`,
		method: "put",
		data,
	});
}

export function updateEquipmentStatus(id, data) {
	return request({
		url: `/propertyEquipment/${id}/operational-status`,
		method: "patch",
		data,
	});
}

export function deleteEquipment(id) {
	return request({
		url: `/propertyEquipment/${id}`,
		method: "delete",
	});
}

export function getMaintenanceRecords() {
	return [];
}
export function addMaintenanceRecord(id) {
	return request({
		url: `/propertyEquipment/${id}`,
		method: "patch",
	});
}
